package ac.leedsmet.devmanager.core;

import java.io.Serializable;

/**
 *  This class is creating new users and storing their "username", "password" and "full name".
 *  Their active variable by default is getting the "Active" value.
 * @author Samael
 * @author Takamura
 * @version 1.0
 */
public class User  implements Serializable, Status {

    private long  userId;
    private String username;
    private String password;
    private String fullname;
    private boolean active = true;

    public String getPassword() {
        return password;
    }

    public String getUsername() {
        return username;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getFullname() {
        return fullname;
    }

    public void setFullname(String fullname) {
        this.fullname = fullname;
    }

    public User(long userId, String username, String password) {
        this.userId = userId;
        this.username = username;
        this.password = password;
    }

    public long getUserId() {
        return userId;
    }

    @Override
    public void deactivate() {
        active = false;
    }

    @Override
    public void activate() {
       active = true;
    }

    /**
     *
     * @return Returns true if the User is active or false if the User is inactive
     */
    @Override
    public boolean isActive() {
        if (active){
            return  true;
        }
        else
            return false;
    }
}
